<?php echo $javascript->link('filter_actions');?>
<div class="providers index">
    <a href="" class="filtro_a" onclick="show_filter(); return false;"><?php echo __('Filtro', true); ?></a>
    <input type="hidden" id="input_filtro" value="0">
    <div id="filtro_busqueda" class="filtro">
        <fieldset>
            <?php echo $form->create('Provider', array('url' => array('controller' => 'providers', 'action' => 'index'))); ?>
            <?php
            echo $form->input('name', array('label' => 'Nombre'));
            echo $form->input('address', array('label' => 'Dirección'));
            echo $form->input('phone_number', array('label' => 'Teléfono Fijo'));
            echo $form->input('movil_number', array('label' => 'Teléfono Celular'));
            echo $form->submit(__('Filtrar', true));
            echo $form->end();
            ?>
        </fieldset>
    </div>
    <h2 class="left"><?php __('Proveedores');?></h2>
    <div class="actions specific right">
        <ul>
            <li><?php echo $this->Html->link(__('Agregar Nuevo', true), array('action' => 'add')); ?> </li>
        </ul>
    </div>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo $this->Paginator->sort('Nombre','name');?></th>
            <th><?php echo $this->Paginator->sort('Dirección','address');?></th>
            <th><?php echo $this->Paginator->sort('Teléfono Fijo','phone_number');?></th>
            <th><?php echo $this->Paginator->sort('Teléfono Celular','movil_number');?></th>
            <th class="actions"><?php __('Acciones');?></th>
        </tr>
        <?php
        if (count($providers) == 0) {
            ?> 
        <tr>
            <td colspan="5">No se encontraron Proveedores</td>
        </tr>
            <?php
        }
        
        $i = 0;
        foreach ($providers as $provider):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
        <tr<?php echo $class;?>>
            <td><?php echo $provider['Provider']['name']; ?>&nbsp;</td>
            <td><?php echo $provider['Provider']['address']; ?>&nbsp;</td>
            <td><?php echo $provider['Provider']['phone_number']; ?>&nbsp;</td>
            <td><?php echo $provider['Provider']['movil_number']; ?>&nbsp;</td>
            <td class="actions">
                    <?php echo $this->Html->link($this->Html->image('icons/magnifier.png'), array('action' => 'view', $provider['Provider']['id']), array('title' => __('Ver', true), 'escape' => false)); ?>
                    <?php echo $this->Html->link($this->Html->image('icons/pencil.png'), array('action' => 'edit', $provider['Provider']['id']), array('title' => __('Editar', true), 'escape' => false)); ?>
                    <?php echo $this->Html->link($this->Html->image('icons/cross.png'), array('action' => 'delete', $provider['Provider']['id']), array('title' => __('Eliminar', true), 'escape' => false), sprintf(__('Seguro que desea eliminar este Proveedor?', true), $provider['Provider']['id'])); ?>
            </td>
        </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
        'format' => __('Página %page% de %pages%, mostrando %current% registros de %count% en total, a partir del registro %start%, terminando en el %end%', true)
        ));
        ?>	</p>

    <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('Anterior', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
        |
        <?php echo $this->Paginator->next(__('Siguiente', true) . ' >>', array(), null, array('class' => 'disabled'));?>
    </div>
</div>